package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.common.model.Result;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IServeProviderService;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: LiuLi
 * @Date: 2025/09/17 下午6:22
 * @Description: 运营端 - 服务人员认证信息审核控制器
 */
@RestController("operationWorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "运营端 - 服务人员认证信息审核相关接口")
public class WorkerCertificationAuditController {

    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService;
    @Resource
    private IServeProviderService serveProviderService;

    @GetMapping("/page")
    @ApiOperation("分页查询认证申请信息")
    public PageResult<WorkerCertificationAuditResDTO> page(WorkerCertificationAuditPageQueryReqDTO queryDTO) {
        // 调用服务层分页查询方法
        return workerCertificationAuditService.pageQuery(queryDTO);
    }

    @ApiOperation("认证审核通过")
    @PutMapping("/audit/{id}")
    public void updateWorkerCertification(@PathVariable("id") Long id, @RequestParam("certificationStatus") Integer certificationStatus, @RequestParam("rejectReason") String rejectReason) {
        workerCertificationAuditService.updateWorkerCertification(id,certificationStatus,rejectReason);
    }

}
